<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>MeteoCal - Search Results</title>
	<link rel="stylesheet" type="text/css" href="${request.contextPath}/resources/css/main.css" />
    </h:head>
    <h:body>
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="60" resizable="false" closable="false" collapsible="false">
		<ui:include src="/includes/header.xhtml"/>
            </p:layoutUnit>
	    <p:layoutUnit position="center" class="content">
		<h1>Search results</h1>
		<h:outputText escape="false" value="#{bundle.ListEventEmpty}" rendered="#{eventController.items.rowCount == 0}"/>

		<h:form>
		    <h:panelGroup rendered="#{eventController.searchedItems.rowCount > 0}">
			<div id="event-container">
			    <ui:repeat var="e" value="#{eventController.searchedItems}">
				<div class="event">
		
                                   <h:commandLink action="#{eventController.eventResultPageView}"><h2>#{e.eventName}</h2></h:commandLink>

				    <h:outputText value="#{e.eventDate}">
					<f:convertDateTime pattern="MM/dd/yyyy h:mm a" />
				    </h:outputText>
				    <p>#{e.eventCity}</p>
				    <p>#{e.userEmail.userFirstName} #{e.userEmail.userLastName}</p>
                               
				    <h:commandLink action="#{eventController.eventResultPageView}" value="View"/>
				
				</div>
			    </ui:repeat>
			</div>
		    </h:panelGroup>
		</h:form>
	    </p:layoutUnit>
	    <p:layoutUnit position="south" size="80" resizable="false" closable="false" collapsible="false">
		<ui:include src="/includes/footer.xhtml"/>
	    </p:layoutUnit>
        </p:layout>
    </h:body>
</html>